import React from 'react'
import { View, Text, Image } from 'react-native'
import { Colors, Metrics, Fonts, } from '../../Themes'
import { WINDOW } from '../../Services'
import LdImage from '../../Components/LdImage'

export default function HomeProductCell(props) {
    let rzImage
    switch (props.isHot) {
        case 1:
            rzImage = require('../../Images/qiyerenzheng.png')
            break;
        // case '个人':
        //     rzImage = require('../../Images/gerenrenzheng.png')
        //     break;
        default:
            rzImage = require('../../Images/weirenzheng.png')
            break;
    }

    let width = (Metrics.screenWidth - 30) / 2

    return (
        <View style={{ backgroundColor: 'white', width: width, marginLeft: 10, marginBottom: 10, borderRadius: 5, shadowColor: '#000000', shadowOpacity: 0.16, shadowRadius: 6, shadowOffset: { width: 0, height: 3 } }}>
            <LdImage
                style={{ width: width, height: width, borderTopLeftRadius: 5, borderTopRightRadius: 5 }}
                url={props.goodsImg?.split(',')[0]}
            />
            <Text style={{ fontSize: 14, fontWeight: 'bold', color: '#222222', marginLeft: 13, marginTop: 10 }} numberOfLines={1}>{props.goodsName}</Text>
            <Text style={{ fontSize: 12, color: '#333333', marginLeft: 13, marginTop: 5 }} numberOfLines={1}>价格{props.goodsPrice}</Text>
            <Text style={{ fontSize: 12, color: '#333333', marginLeft: 13, marginTop: 2 }} numberOfLines={1}>浏览：{props.clickCount}</Text>
            <View style={{ flexDirection: 'row', alignItems: 'center', marginLeft: 13, marginRight: 5, marginTop: 10 }}>
                <Image source={require('../../Images/icon_hpme_dizhi_nor.png')} />
                <Text style={{ fontSize: 11, color: Colors.mainColor, marginLeft: 5, textAlign: 'right' }} numberOfLines={1}>{props.addressDetail || '北京'}</Text>
            </View>
            <Text style={{ fontSize: 11, color: '#AAAAAA', alignSelf: 'flex-end', marginRight: 13, marginTop: 5, marginBottom: 18 }}>{props.createTime}</Text>
            <Image source={rzImage} style={{ position: 'absolute', top: 5, right: 5 }} />
        </View>
    )




}                                                     